package com.tai.confluence;

import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;

/**
 * The type Test api.
 *
 * @Desc : 集成confluence api测试
 * @Author ： taylor
 * @Date ：2022/2/21 14:14
 */
public class TestAPI {
    /**
     * The entry point of application.
     *
     * @param args the input arguments
     * @throws UnirestException the unirest exception
     */
    public static void main(String[] args) throws UnirestException {

        HttpResponse<JsonNode> response = Unirest.get("https://k.teld.cn/rest/api/search")
                .header("Accept", "application/json")
                .header("Authorization", "Basic 277BF1DC3C2F6D29C3FD65E1B3809C15")
                .queryString("cql", "siteSearch ~ \"充电体验\" AND type in (\"space\",\"user\",\"page\",\"blogpost\",\"comment\",\"attachment\")")
                .asJson();
        System.out.println(response.getBody());
    }
}
